// 管理账号信息
const USERS_KEY = 'USERS_KEY';
const STATE_KEY = 'STATE_KEY';

const getUsers = function() {
	let ret = '';
	ret = uni.getStorageSync(USERS_KEY);
	if (!ret) {
		ret = '[]';
	}
	return JSON.parse(ret);
}

const addUser = function(userInfo) {
	let users = getUsers();
	users.push({
		account: userInfo.account,
		password: userInfo.password
	});
	uni.setStorageSync(USERS_KEY, JSON.stringify(users));
}

/**
 * 登录类型
 */
const getAppType = function() {
	// #ifdef MP-WEIXIN
	return  'wx';
	// #endif
	// #ifdef H5
	return 'h5';
	//#endif
	// #ifdef MP-ALIPAY
	return 'ali';
	//#endif
	// #ifdef MP-BAIDU
	return 'bd';
	//#endif
	// #ifdef MP-TOUTIAO
	return 'tt';
	//#endif
	// #ifdef APP-NVUE || APP-PLUS || APP-PLUS-NVUE || APP-VUE
	return 'app';
	//#endif
	// #ifdef APP-HARMONY
	return 'hms';
	//#endif
	return '';
}
/**
 * 
 */
const storageKeies = function() {
	return {
		flowChangeCache:"form-show-flow-change-cache"
	}
}

export default {
	getUsers,
	addUser,
	getAppType,
	storageKeies
}
